package com.android.matrixtest;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class MatrixTest extends Activity {
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new SampleView(this));
    }
 
    private static class SampleView extends View {
    	
    	private final Matrix mMatrix = new Matrix();
    	
        public SampleView(Context context) {
            super(context);
        }
        
        @Override protected void onDraw(Canvas canvas) {
            Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.beach);
            //canvas.drawBitmap(bmp, 0, 0, null);
            //mMatrix.setTranslate(10, 10);
            //mMatrix.setRotate(10);
            canvas.drawBitmap(bmp, mMatrix, null);
            Paint paint = new Paint();
            paint.setColor(0x00ff2222);
            paint.setAlpha(255);
            canvas.drawCircle(100, 300, 10, paint);
        }
    	
    }    
    
}